<template>
  <div>
      <h1>汽车管理</h1>
      <img src="/project/html/begin.jpg" width="800" height="600">
      <ListCar :cutbean="cutbean" :carObj="carObj" @findByItem="findByItem" @findById="findById"></ListCar>
      <AddCar  @findByItem="findByItem"></AddCar>
       <UpdateCar :carObj="carObj"  @findByItem="findByItem"></UpdateCar>
  </div>
</template>

<script>
import ListCar from "./carpage/ListCar.vue"
import AddCar from "./carpage/AddCar.vue"
import UpdateCar from "./carpage/updateCar.vue"
export default {
    components:{ListCar,AddCar,UpdateCar},
        data(){
        return {
            carObj:{},
            cutbean:{}
        }
    },
    methods:{
       async findByItem(param){
           var cutObj = await this.ajax.getSubmit("/project/car/findByItem",param);
           console.log(JSON.stringify(cutObj));
           this.cutbean=cutObj;
        },
       async  findById(id){
            alert("父容器"+id);
           this.carObj =await this.ajax.getSubmit("/project/car/findById",{id:id});
           
        }
    },
    created(){
        this.findByItem({page:1});
    }
}
</script>

<style>

</style>